//
//  LoginViewController.h
//  BombAbility
//
//  Created by oscar chinellato on 26/02/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "MainViewController.h"
#import "Bomb.h"

@class MainViewController;


@interface LoginViewController : UIViewController {

	// componenti della view
	IBOutlet UITextField *username;
	IBOutlet UITextField *password;
	IBOutlet UILabel *resultLabel;
	
	// puntatori alle view (settati da IB)
	IBOutlet UIView *loginView;
	IBOutlet UIView *registrationView;
	
	// riferimento al main controller
	MainViewController *mainController;
	
	// campi per la gestione della connessione
	NSURLConnection *connection;
	NSData *receivedData;
	
	// PARSER VARS
	BOOL isParsing;
	BOOL isParsingBombs;
	NSMutableString *currentParsedData;
	NSMutableArray *parsedBombs;
	
}


@property (nonatomic, retain) IBOutlet UITextField *username;
@property (nonatomic, retain) IBOutlet UITextField *password;
@property (nonatomic, retain) IBOutlet UILabel *resultLabel;
@property (nonatomic, retain) NSURLConnection *connection;

@property (nonatomic, retain) UIViewController *mainController;
@property (nonatomic, retain) NSData *receivedData;
@property (nonatomic, retain) NSMutableString *currentParsedData;
@property (nonatomic, retain) NSMutableArray *parsedBombs;

@property (nonatomic, retain) IBOutlet UIView *loginView;
@property (nonatomic, retain) IBOutlet UIView *registrationView;


-(IBAction)login;
-(IBAction)killKeyboard:(UITextField *)textField;

@end
